<HTML><HEAD><TITLE>library(gnuplot)</TITLE></HEAD><BODY>
[ <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]<H1>library(gnuplot)</H1>
Interface to the function and data plotting program - gnuplot
<H2>Predicates</H2>
<BLOCKQUOTE>
<DL>
<DT><A HREF="plot-1.html"><STRONG>plot(++Data)</STRONG></A></DT>
<DD>Plot the given data using default options</DD>
<DT><A HREF="plot-2.html"><STRONG>plot(++Data, +Options)</STRONG></A></DT>
<DD>Plots the given data using the given options</DD>
<DT><A HREF="plot-3.html"><STRONG>plot(++Data, +Options, +OutputFile)</STRONG></A></DT>
<DD>Plots the given data to a file.</DD>
<DT><A HREF="plot-4.html"><STRONG>plot(++Data, +Options, +Format, +OutputFile)</STRONG></A></DT>
<DD>Plots the given data to a file in the given format.</DD>
</DL>
</BLOCKQUOTE>
<H2>Description</H2>
<P> This library provides an interface to the function and data
 plotting program - gnuplot.

<P> The gnuplot program is available for most platforms and can be
 downloaded from <a href="http://www.gnuplot.info/">http://www.gnuplot.info/</a>.
 This version of lib(gnuplot) officially supports gnuplot version 3.7
 and higher though it may work with earlier versions as well.

<P> The executable <code>gnuplot</code> on Unices, and
 <code>pgnuplot.exe</code> on Windows must be installed on the default
 path, or be present in the current working directory. 
 NOTE: On Windows it is NOT sufficient to simply have the
 <code>gnuplot.exe</code> or <code>wgnuplot.exe</code>, you must have the
 <code>pgnuplot.exe</code> as well.

<P> See the various <code>plot</code> predicates for further example usage.

<P> For a complete description of the avilable options we refer the
 user to the excellent documentation which accompanies gnuplot.  
 Most features have an obvious analogue in this library.
 
<P> Syntax note: wherever gnuplot expects a string as an option value,
 use a double-quoted ECLiPSe string - unquoted or single-quoted atoms
 will not work!.
 
<H2>Examples</H2>
<PRE>
:-lib(gnuplot).

sample:-
        % x-y pairs with 'points'
        A=[1-3,5-2,9-2,8-2,5-7], plot(A, [with:points]),

        % y values with large 'smooth' lines and points
        B=[1,2,3,4,8,9,4,2,4,6], plot(B, [smooth: csplines,
                                          with:linespoints,
                                          pointsize:3]),

        % multiple y values in nested lists with lines, boxes and titles
        C=[[1,2,4,9,18,27,3],[1,4,16,36,25,16,9]],
        plot(C, [with:[lines, boxes], title:['data 1', 'data 2']]),

        % multiple y values in an array, in a certain range, with impulses of
        % different widths
        D=[]([](1,2,4,6,7,8,9),[](1,4,16,36,49,64,81)),
           plot(D, [ranges:(3:6), with:impulses, linewidth:[8,2]]),

        % multiple t-r pairs, in polar coordinates with a grid and lines
        E=[[1-3,5-2,9-2,8-2,5-7], [1-2,5-4,8-6,9-1,12-4]],
           plot(E,[set:[polar, grid=polar], with:lines]),

        
        % compute sin and cos and tan points
        (for(I, 0, 314),
         foreach(R-X,SinPoints),
         foreach(R-Y,CosPoints),
         foreach(R-Z,TanPoints)
        do
            R is I / 100,
            X is sin(R),
            Y is cos(R),
            Z is tan(R)
        ),
        % plot sin and cos on a polar plot
        plot([SinPoints, CosPoints],
             [set:[polar, grid=polar], with:linespoints,
              title:["sin", "cos"]]),

        % plot sin, cos and tan on a logarithmic polar plot
        plot([SinPoints, CosPoints, TanPoints],
             [set:[polar, grid=polar,logscale=xy], with:linespoints,
              title:["sin", "cos", "tan"]]),
        
        % a(x,y,error) = x-y data with error values for the y values
        F=[a(1,1,0.1),a(2,2,0.1),a(5,3,0.5),a(6,2,0.5), a(7,3,0.5)],
        plot(F, [ranges:[ 0:8, 0:6], with:boxes]),
        plot(F, [ranges:[ 0:8, 0:6], with:errorbars]),
        plot(F, [ranges:[ 0:8, 0:6], with:boxerrorbars]),
        
        % a(x,y,error) = x-y data with error values for the y values
        % and a gap between x=2 and x=5
        G=[a(1,1,0.1),a(2,2,0.1),-,a(5,3,0.5),a(6,2,0.5), a(7,3,0.5)],
        plot(G, [ranges:[ 0:8, 0:6], with:boxes]),
        plot(G, [ranges:[ 0:8, 0:6], with:errorbars]),
        plot(G, [ranges:[ 0:8, 0:6], with:boxerrorbars]).
        
</PRE>
<H2>About</H2><UL COMPACT>
<LI><STRONG>Author: </STRONG>Andrew J Sadler, IC-Parc
<LI><STRONG>Date: </STRONG>$Id: gnuplot.ecl,v 1.2.2.2 2009/02/19 06:12:08 jschimpf Exp $
</UL>
<HR>Generated from gnuplot.eci on 2009-05-27 01:25
</BODY></HTML>
